<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="div1"></div>
    <script>
        var str=""
        // 空字符串忘记加
        var div1=document.getElementById("div1");
        var i=0;

        // document.getElementById 单词打错了
        str += "<ul>";
        while(i++<6){

            str += "<li>"+i+"</li>"
            // 注意中间的i是字符串
            
        }

        str += "</ul>";
        
        div1.innerHTML=str;
        // innerHTML单词写错
    </script>
</body>
</html>